<?php
/**
 * @package WordPress
 * @subpackage Elespectador_Theme
 */

get_header(); 
$blog_url = get_bloginfo(url);
 ?>
<div class="cabezote_blogs">
<h2><a href="<?php echo $blog_url;?>">
BLOGS</a>
</h2>
</div>
<?php /*GOLCARACOL if ($seccion[0]->image=='gol'){
	echo '<div class="title_blog">
<a href="'.$blog_url.'" title="Blogs Caracoltv.com">'. get_bloginfo('name').'</a></div>';	
}*/
?>
	<div class="bloque_izq" role="main">
    <div class="cabezote">
        <a href="<? echo site_url();?>"  title="<? echo  get_bloginfo('name'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/<?php echo $blog_id; ?>.jpg" height="91px"></a>
        </div>

	<?php if (have_posts()) : ?>

		<div class="titular_seccion">
<h2>Resultados de b&uacute;squeda</h2>
</div>
<div class="palabra_clave">
<h2>
Palabra clave:
<span><?php echo get_query_var( 's' ); ?></span>
</h2>
</div>
		<?php while (have_posts()) : the_post(); ?>

			<div class="un_post_despliegue" style="margin-top: 0pt;">
				<div class="datos_post_despliegue">
					<div class="fecha_post">
						<h2><?php the_time('d') ?></h2>
						<h3><?php the_time('m') ?></h3>
						<h4><?php the_time('Y') ?></h4>
						<div class="clear"></div>
					</div><?php  
					?>
					<div class="el_post_despliegue">
						<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
					</div><div class="clear"></div>
				</div>
				<div class="info_post_home_seccion">
				<?php //echo the_content_2('','',''); 
						$content =str_replace("</p>","",str_replace("<p>","",the_content('','',''))); 
						$img = get_string_between($content, '<img','/>');
					
								
						$img_tam = get_string_between($content, '-','jpg');
						$img_tamano = get_string_between($content, 'src="http','jpg');
						$img_tamano = get_string_between($img_tamano, '-','.');
						$leyenda = get_string_between($content, '<div','</div>');
						//$leyenda=get_string_between($img,'alt="','"'); 
						//echo "leyenda".$leyenda;
						/*$img_width= 'width="'.($img_width = get_string_between($img, 'width="','"'));
						$img_height= 'height="'.($img_height = get_string_between($img, 'height="','"'));
						$img = str_replace($img_width,'width="174', $img);
						$img = str_replace('height="320','height="116', $img);*/
				
				
						$audio = get_string_between($content, '.mp3','</a>');
						$audio2 = get_string_between($content, '[audio',']');
				
						$gale = get_string_between($content, '[galler',']');
				//		print_r($gale);
				
						
				
						$video = get_string_between($content, '[youtube]','[/youtube]');
						//echo $video;
						if($video!='')
						{
							$video = substr($video,strpos($video,'v=')+2);
						}
						
				
						$caption = get_string_between($content, '[caption id','[/caption]');
				
						
						//print_r($caption);
						//$content = str_replace('<div'.$leyenda.'</div>','', $content);
						$content = str_replace('<img'.$img.'/>','', $content);
						$content = str_replace('[youtube]'.$video.'[/youtube]','', $content);
						$content = str_replace('[caption id'.$caption.'[/caption]','', $content);	
						$content = str_replace('[galler'.$gale.']','', $content);
						$content = str_replace('[audio'.$audio2.']','', $content);
						$content= buscarmp3contenido($content);
						

			
						?>
						<p><a href="<?php the_permalink(); ?>"><?php echo $content;?> </a></p>
					
					
						<div class="herramientas_post">
							<div class="categoria" style="border-bottom: medium none;">
								<h2>Categoria<br /><strong><?php the_category(', ') ?></strong></h2>
							</div>
							<div class="tagsb">
								<h2>TAGS<br />
								<?php the_tags( '<strong>', ' -', '</strong>'); ?>
								</h2>
							</div>
							<div class="comentarios">
								<h2>comentarios<br /><strong><?php  comments_number('0', '1', '%' );?></strong></h2>
							</div>
							<div class="calificacion">
	                            <h2 style="margin-left: 0pt;">ranking</h2>
								<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
							</div>
						</div>
					
					<div class="clear"></div>
				</div>
				<div class="ver_mas">
					<h2>
						<a href="<?php the_permalink();?>">Ver m&aacute;s</a>
					</h2>
				</div>
				
				
				<!--<h2><a href="<?php /*the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
				<small><?php the_time('d m Y') ?>  by <?php the_author() ?></small>

				<div class="entry">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>

				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); */?></p>-->
			</div>

		<?php endwhile; ?>
        <div class="paginacionbus">
<ul>
<li>
<?php previous_posts_link('&laquo;Anterior') ?>
</li>
<li>
<?php next_posts_link('Siguiente&raquo;') ?>
</li>
</ul>
</div>
<div class="clear">
</div>

	<?php else : ?>

<div class="bloque_izq">
<div class="box">
	<h2>La b&uacute;squeda no ha retornado resultados</h2>
	<div class="content">
		<p>Sugerencias:</p>
		<ul>
			<li>Aseg&uacute;rese que todas las palabras se encuentran escritas correctamente.</li>
			<li>Trate diferentes palabras u otras m&aacute;s gen&eacute;ricas.</li>
		</ul>
	</div>
</div>
				</div>

	<?php endif; ?>

	</div>
<div class="bloque_der"><?php get_sidebar();?></div>
</div>
<?php get_footer(); ?>
